<!--
 * @FileDescription: hr搜索得到信息表单（已合并到search.vue中
 * @Author: 叶永鸿、袁年政
 * @Date: 2021-7-17
 * @LastEditors: 叶永鸿
 * @LastEditTime: 2021-7-18
 -->
<template>
  <el-button @click="printfInfor()"></el-button>
  <div>
    <el-table
      :data="searchedInforToChild"
      style="width: 100%"
      max-height="1000"
    >
      <el-table-column prop="picture" label="头像" width="200">
      </el-table-column>
      <el-table-column prop="realname" label="姓名" width="200">
      </el-table-column>
      <el-table-column prop="telephone" label="电话" width="300">
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template #default="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >查看</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>


<script lang="ts">
import { inject, ref, getCurrentInstance, computed } from "vue";

export default {
  name: "searchInfor",
  // props: {
  //   searchedInforToChild:{
  //     type:Array,
  //     required:true,
  //     default(){
  //       return []
  //     }
  //   }
  // },
  setup() {
    //@ts-ignore
    const { proxy } = getCurrentInstance();
    const searchedInforToChild = inject("searchedInforToChild");
    const handleClick = (rowIndex: number) => {
      console.log(rowIndex);
    };
    const printfInfor = () => {
      console.log(proxy.searchedInforToChild);
    };

    return { handleClick, printfInfor, searchedInforToChild };
  },
};
</script>

<style>
</style>
